<!--
 * Copyright ©
 * #  
 * @author: zw
 * @date: 2021-11-05 
 -->

<template>
  <TodoItem
    v-for="item of todoList"
    :key="item.id"
    :item="item"
    @removeTodo="removeTodo"
    @setStatus="setStatus"
    @setDoing="setDoing"
  />
</template>

<script lang="ts">
import { defineComponent, PropType } from "vue";
import TodoItem from "../Item/index.vue";
import { ITodo } from "@/typings";
import { useTodo, IUseTodo } from "../../hooks";
export default defineComponent({
  name: "TodoInput",
  components: { TodoItem },
  props: {
    todoList: Array as PropType<ITodo[]>,
  },
  setup(props, { emit, slots }) {
    const { removeTodo, setStatus, setDoing }: IUseTodo = useTodo();
    return {
      removeTodo,
      setStatus,
      setDoing,
    };
  },
});
</script>

<style lang="css" scoped></style>
